package com.campus.counseling.model.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.campus.counseling.entity.CounselorAccount;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

public interface CounselorAccountMapper extends BaseMapper<CounselorAccount> {
    
    /**
     * 获取咨询师收入统计
     */
    List<Map<String, Object>> selectIncomeStats(@Param("counselorId") Long counselorId,
                                              @Param("startTime") LocalDateTime startTime,
                                              @Param("endTime") LocalDateTime endTime);
    
    /**
     * 获取待结算金额
     */
    BigDecimal selectPendingSettlement(@Param("counselorId") Long counselorId);
    
    /**
     * 获取历史结算记录
     */
    Page<Map<String, Object>> selectSettlementHistory(Page<Object> page,
                                                    @Param("counselorId") Long counselorId);
    
    /**
     * 更新账户余额
     */
    int updateBalance(@Param("counselorId") Long counselorId,
                     @Param("amount") BigDecimal amount,
                     @Param("type") String type);
} 